Skip to content

[React Native] Fix AcceleratedCheckoutButtons touch area smaller than the buttons - #548

Merged
kyle-schellen merged 1 commit into
mainfrom
ks/accelerated-checkout-buttons-height
Oct 22, 2026
Merged

kyle-schellen merged 1 commit into
mainfrom
ks/accelerated-checkout-buttons-height

Conversation

@kyle-schellen

@kyle-schellen kyle-schellen commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #502 for @shopify/checkout-sheet-kit 3.x.

AcceleratedCheckoutButtons set flex: 1, which gives the view a flex basis of 0. In a parent with no explicit height, the view is laid out from that basis instead of the height the native buttons report: 0 pt in a plain View, 48 pt in a View with only minHeight: 48. The buttons still draw at full size, but taps near their top and bottom edges do nothing. Inside a ScrollView, where the sample places them, flex: 1 already worked. flexGrow: 1 keeps the reported height and still fills the width in row layouts.

Before After
548-before 548-after

The dashed red outline marks the area that receives taps. I added it only for these screenshots.

How to test

  1. In sample/src/screens/CartScreen.tsx, move the Apple Pay and Shop Pay AcceleratedCheckoutButtons below the ScrollView and wrap them in <View style={{minHeight: 48}}>.
  2. Add an item to the cart and tap the bottom of the Shop Pay button. On main, nothing happens. With this change, checkout opens.

I tested on iOS 18.6 and iOS 26.2 simulators. Buttons inside a ScrollView and in a row behave the same as before. Jest and lint pass.

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Coverage Report

Lines Statements Branches Functions
Coverage: 99%
99.12% (227/229) 94.61% (123/130) 100% (67/67)

@kyle-schellen kyle-schellen self-assigned this Oct 20, 2026
`flex: 1` gives the view a flex basis of 0. When the parent's height is
bounded, React Native lays the view out from that basis instead of the
height reported by the native view, so the view is shorter than the
buttons it draws and taps outside it are dropped.

Use `flexGrow: 1` so the view is sized from the reported height while
still filling row and taller parents.
@kyle-schellen
kyle-schellen force-pushed the ks/accelerated-checkout-buttons-height branch from 962fc21 to 17d07ed Compare October 20, 2026 23:37
@kyle-schellen kyle-schellen changed the title Fix AcceleratedCheckoutButtons touch area in bounded-height parents [React Native] Fix AcceleratedCheckoutButtons touch area in bounded-height parents Oct 21, 2026
@kyle-schellen kyle-schellen changed the title [React Native] Fix AcceleratedCheckoutButtons touch area in bounded-height parents [React Native] Fix AcceleratedCheckoutButtons touch area smaller than the buttons Oct 21, 2026
@kyle-schellen
kyle-schellen marked this pull request as ready for review October 21, 2026 20:47
@kyle-schellen
kyle-schellen requested a review from a team as a code owner October 21, 2026 20:47
@kyle-schellen
kyle-schellen merged commit 36b3899 into main Oct 22, 2026
8 checks passed
@kyle-schellen
kyle-schellen deleted the ks/accelerated-checkout-buttons-height branch October 22, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants